# 高阶函数

l = [{'name': 'sz', 'age': 11}, {'name': 'wyl350', 'age': 12}]

def getKey(x):
    return x['age']
result = sorted(l, key= getKey)

print(result)

def calculate(num1, num2, calculateFunc):
    print(calculateFunc(num1, num2))

def sum(a, b):
    return a + b

def jianfa(a, b):
    return a - b

calculate(1, 2, sum)
calculate(1, 2, jianfa)

